package src.io;

import java.io.*;

public class MyStreamReaderWriter {
    public static void main(String[] args) throws IOException {
        FileInputStream in=new FileInputStream("e:\\test.txt");
        InputStreamReader isr=new InputStreamReader(in);
        /*int b;
        while ((b=isr.read())!=-1){
            System.out.print((char)b);
        }*/
        FileOutputStream  out=new FileOutputStream("e:\\out.txt");
        OutputStreamWriter osw=new OutputStreamWriter(out,"gbk");
        char [] chars=new char[1*1024];
        int c;
        while ((c=isr.read(chars,0,chars.length))!=-1){
            osw.write(chars,0,c);
            osw.flush();
        }
        in.close();
        isr.close();
        out.close();
        osw.close();
    }
}
